package com.softer.zfbz.controller;

import com.softer.zfbz.entity.SqacceptBaseInfo;
import com.softer.zfbz.service.SqacceptBaseInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@Slf4j
/**
 * 住房保障查询接口类
 * SqacceptBaseInfoController class
 * @author zcz
 * @date 2018/11/8
 */
@CrossOrigin
public class SqacceptBaseInfoController {
    @Autowired
    SqacceptBaseInfoService sqacceptBaseInfoService ;

    /**
     * 审核流程查询
     * @param cardid
     * @return
     */

    @PostMapping("SearchShlc")
    List<SqacceptBaseInfo> SearchShlc(String cardid){
        log.info("审核流程查询开始，cardid："+cardid);
        List<SqacceptBaseInfo> list = sqacceptBaseInfoService.getShlc(cardid);
        log.info("审核流程查询结束，list.size："+list.size());
        return list;
    }
    /**
     * 审核流程查询count
     * @param cardid
     * @return
     */
    @RequestMapping("/SearchShlcCount")
    public Integer getShlcCount(String cardid){
        log.info("审核流程查询count开始！cardid:"+cardid);
        Integer count=sqacceptBaseInfoService.getShlcCount(cardid);
        log.info("审核流程查询count结束！count:"+count);
        return count;
    }
    /**
     * 住房补贴查询
     * @param cardid
     * @return
     */
    @PostMapping("SearchZfbt")
    List<SqacceptBaseInfo> SearchZfbt(String cardid){
        log.info("住房补贴查询开始，cardid："+cardid);
        List<SqacceptBaseInfo> list = sqacceptBaseInfoService.getZfbt(cardid);
        log.info("住房补贴查询结束，list.size："+list.size());
        return list;
    }
    /**
     * 住房补贴查询count
     * @param cardid
     * @return
     */
    @PostMapping("SearchZfbtCount")
    public Integer getZfbtCount(String cardid){
        log.info("住房补贴查询count开始！cardid:"+cardid);
        Integer count=sqacceptBaseInfoService.getZfbtCount(cardid);
        log.info("住房补贴查询count结束！count:"+count);
        return count;
    }
    /**
     * 保障房查询
     * @param cardid
     * @return
     */
    @PostMapping("SearchBzf")
    List<SqacceptBaseInfo> SearchBzf(String cardid){
        log.info("保障房查询开始，cardid："+cardid);
        List<SqacceptBaseInfo> list = sqacceptBaseInfoService.getBzf(cardid);
        log.info("保障房查询结束，list.size："+list.size());
        return list;
    }
    /**
     * 保障房查询count
     * @param cardid
     * @return
     */
    @PostMapping("SearchBzfCount")
    public Integer getBzfCount(String cardid){
        log.info("保障房查询count开始！cardid:"+cardid);
        Integer count=sqacceptBaseInfoService.getBzfCount(cardid);
        log.info("保障房查询count结束！count:"+count);
        return count;
    }
}
